<?php
$configFile = $_SERVER["DOCUMENT_ROOT"] . "/system/conf/config.php";
$configFile = str_replace("\\","/",$configFile);
 
/*
if(!file_exists($configFile)){
	$temp = str_replace(".php",".asp",$configFile);
	if(file_exists($temp)){
		$configFile = $temp ;
	}
}
*/
require_once($configFile);
require_once($configs["framework_dir"]."/common/global_func.php");
require_once($configs["framework_dir"]."/common/global_class.php");
require_once($configs["framework_dir"]."/common/session_func.php");
require_once($configs["framework_dir"]."/common/html_func.php");
require_once($configs["framework_dir"]."/common/global_lang.php");
require_once($configs["framework_dir"]."/common/memcache_func.php");
require_once($configs["feease_common_dir"]."/functions/feease_func.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/system/include/load_user_from_session.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/system/include/project_func.php");
$root = deep_get("EXPLOER_ROOT",false,get_real_folder("./"));
$path = deep_get("EXPLOER_FOLDER",false,$root);

$fileName = get("fileName");
$file = $path .$fileName   ;

$root_dir = basename($root);
//echo "file:" .  $file . "<br>" ;
// echo basename("c:/addfa/bb/dfdf.txt",".txt");

if(!is_allow_down($root_dir,$fileName)){
	echo print_r($sessionUser);
	$error_title = label("common.undown_load");
	do_every("parent.alert('$error_title');");
	return;
}
saveUserAction('privileges.manage_files_down',true,'下载的文件名称：'.get("fileName")) ;
download_file($file);
?>